package com.sparrow.example_message.map.resp;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.*;

import java.util.*;

import com.google.protobuf.*;

import java.io.IOException;

import com.baidu.bjf.remoting.protobuf.code.*;


public class RespPlayerAppearPacket$$JProtoBufClass implements com.baidu.bjf.remoting.protobuf.Codec<RespEntityAppearPacket>, Serializable {
	public static final long serialVersionUID = 1L;
    private com.google.protobuf.Descriptors.Descriptor descriptor;

    public byte[] encode(RespEntityAppearPacket t) throws IOException {
        CodecOutputByteArray output = CodecOutputByteArray.get();
        doWriteTo(t, output.getCodedOutputStream());
        return output.getData();
    }

    public RespEntityAppearPacket decode(byte[] bb) throws IOException {
        CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length);
        return readFrom(input);
    }

    public int size(RespEntityAppearPacket t) throws IOException {
        int size = 0;
        
        Collection f_1 = null;
        if (!CodedConstant.isNull(t.getRoles())) {
            f_1 = t.getRoles();  
            size += CodedConstant.computeListSize(1, f_1, com.baidu.bjf.remoting.protobuf.FieldType.OBJECT, false, null,false);

        }
        
        
        Collection f_2 = null;
        if (!CodedConstant.isNull(t.getMonsters())) {
            f_2 = t.getMonsters();  
            size += CodedConstant.computeListSize(2, f_2, com.baidu.bjf.remoting.protobuf.FieldType.OBJECT, false, null,false);

        }
        
        
        return size;
    }
 
    public void doWriteTo(RespEntityAppearPacket t, CodedOutputStream output)
            throws IOException {
         
        Collection f_1 = null;
        if (!CodedConstant.isNull(t.getRoles())) {
            f_1 = t.getRoles();
            if (f_1 != null){
CodedConstant.writeToList(output,1,com.baidu.bjf.remoting.protobuf.FieldType.OBJECT,f_1,false);
}
  
        }
        
        Collection f_2 = null;
        if (!CodedConstant.isNull(t.getMonsters())) {
            f_2 = t.getMonsters();
            if (f_2 != null){
CodedConstant.writeToList(output,2,com.baidu.bjf.remoting.protobuf.FieldType.OBJECT,f_2,false);
}
  
        }
        
    }            
 
    public void writeTo(RespEntityAppearPacket t, CodedOutputStream output)
            throws IOException {
        doWriteTo(t, output);
    }
 
    public RespEntityAppearPacket readFrom(CodedInputStream input) throws IOException {
        RespEntityAppearPacket ret = new RespEntityAppearPacket();
        
        ret.setRoles(new ArrayList())
;
ret.setMonsters(new ArrayList())
;


        
        try {
            boolean done = false;
            Codec codec = null;
            while (!done) {
                int tag = input.readTag();
                if (tag == 0) {
                    break;
                }
                
                if (tag == 10) {
                    codec = ProtobufProxy.create(com.sparrow.example_message.map.vo.SceneRoleVO.class, false,ProtobufProxy.OUTPUT_PATH.get());
int length = input.readRawVarint32();
final int oldLimit = input.pushLimit(length);

                    if ((ret.getRoles()) == null) {
List __list = new ArrayList();
ret.setRoles(__list);
}
(ret.getRoles()).add((com.sparrow.example_message.map.vo.SceneRoleVO) codec.readFrom(input));

                    input.checkLastTagWas(0);
input.popLimit(oldLimit);

                    
                    continue;
                }
                
                
                if (tag == 18) {
                    codec = ProtobufProxy.create(com.sparrow.example_message.map.vo.MonsterVO.class, false,ProtobufProxy.OUTPUT_PATH.get());
int length = input.readRawVarint32();
final int oldLimit = input.pushLimit(length);

                    if ((ret.getMonsters()) == null) {
List __list = new ArrayList();
ret.setMonsters(__list);
}
(ret.getMonsters()).add((com.sparrow.example_message.map.vo.MonsterVO) codec.readFrom(input));

                    input.checkLastTagWas(0);
input.popLimit(oldLimit);

                    
                    continue;
                }
                
                               
                
                input.skipField(tag);
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e;
        } catch (java.io.IOException e) {
            throw e;
        }

        return ret;       
        
    } 
 
 
     public com.google.protobuf.Descriptors.Descriptor getDescriptor() throws IOException {
        if (this.descriptor != null) {
            return this.descriptor;
        }
        com.google.protobuf.Descriptors.Descriptor descriptor =
                CodedConstant.getDescriptor(RespEntityAppearPacket.class);
        return (this.descriptor = descriptor);
    }   
}

    